package cn.com.utt.common.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import cn.com.utt.common.vo.LockIp;

@Mapper
public interface LockIpMapper {
	@Insert("insert into lock_ip(ip,failtimes)values(#{ip},#{failtimes})")
	void save(@Param("ip") String ip,@Param("failtimes") byte failtimes);
	
	@Update("update lock_ip set failtimes=#{failtimes},lock_time=now() where ip=#{ip}")
	void update(@Param("ip") String ip,@Param("failtimes") byte failtimes);

	@Delete("delete FROM lock_ip where ip=#{ip}")
	void deleteByIp(@Param("ip") String ip);

	@Select("SELECT * FROM lock_ip where ip=#{ip}")
	LockIp queryByIp(@Param("ip") String ip);

}
